package vinh.game;

public class Shot extends PolygonSprite{
	public static int MAX = 20;
	
	public double speed = 3.0;
	
	//initialize the direction of the bullets according to the position of the shuttle when created
	public Shot(double angle, int x, int y ){
		this.angle = angle;
		this.x = x;
		this.y = y;
		this.delta_angle = 0;
		this.delta_x = Math.round(this.speed * Math.cos(this.angle + Math.PI/2) );
		this.delta_y = Math.round(this.speed * Math.sin(this.angle + Math.PI/2) );
		createShot();
	}
	
	//give the shape of the shot bullet
	private void createShot(){
		this.shape.addPoint(1, 1);
		this.shape.addPoint(1, -1);
		this.shape.addPoint(-1, 1);
		this.shape.addPoint(-1, -1);
		
	}
	
	
}
